<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:31:"./themes/admin/login/index.html";i:1743562673;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title><?php echo $setup['title']; ?></title>
    <meta content="<?php echo $setup['keywords']; ?>" name="keywords" />
    <meta content="<?php echo $setup['description']; ?>" name="description" />
    <?php if($setup['ico'] != null): ?><link rel="shortcut icon" type="image/x-icon"  href="/public/uploads/<?php echo $setup['ico']; ?>"/><?php endif; ?>
    <link rel="stylesheet" href="/public/static/css/login.css" type="text/css" />
    <link rel="stylesheet" href="/public/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/public/layuiadmin/style/admin.css" media="all">
    <!--CSS引用-->
    
    <!--页面CSS-->
    <!--[if lt IE 9]>
    <script src="/public/static/js/html5shiv.min.js"></script>
    <script src="/public/static/js/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="content">
    <div class="login_content">
        <div class="login_box">
            <div class="login">
                <div class="login_logo"><a href="#"><img src="/public/static/images/logo.png" /></a></div>
                <div class="login_name">
                    <p><?php echo $setup['title']; ?></p>
                </div>
                <form class="layui-form" action="" method="post">
                    <div class="layui-form-item">
                        <div class="layui-input-inline" style="width:100%;">
                            <input type="text" name="username" lay-verify="username" autocomplete="off" placeholder="请输入用户名" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-inline" style="width:100%;">
                            <input type="password" name="password" lay-verify="pass" placeholder="请填写5到12位密码" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-inline" style="width:60%;">
                            <input type="text" name="verify" lay-verify="verify" placeholder="请输入验证码" autocomplete="off" class="layui-input">
                        </div>
                        <div style="float:left;">
                            <img src="<?php echo captcha_src(); ?>" alt="点击更换" title="点击更换" onclick="this.src='<?php echo captcha_src(); ?>?time='+Math.random()" style="width:140px;height:50px;">
                        </div>
                    </div>
                    <div class="layui-form-item" style="text-align: center;">
                        <button class="layui-btn" lay-submit="" lay-filter="loginsubmit" style="background-color: #27A9E3;width:100%;height:50px;">登 录</button>
                    </div>
                </form>
            </div>
            <div class="copyright">© <?php echo $setup['copyright']; ?>　<?php if($setup['technology_name'] != null): ?>技术支持：<a href='<?php echo $setup['technology_url']; ?>' target='_blank' style="color:#ffffff;"><?php echo $setup['technology_name']; ?></a><?php endif; ?>　<?php if($setup['technology_tel'] != null): ?><?php echo $setup['technology_tel']; endif; ?></div>

        </div>
    </div>
</div>
<script src="/public/static/js/jquery.min.js"></script>
<script src="/public/layuiadmin/layui/layui.js"></script>
<script>
    layui.use(['form'], function(){
        var form = layui.form;

        //自定义验证规则
        form.verify({
            username: function(value){
                if(value.length < 5){
                    return '用户名至少得5个字符';
                }
            },
            pass: [/(.+){5,12}$/, '密码必须6到12位'],
            verify: function(value){
                if(!value){
                    return '验证码不能为空';
                }
            }
        });

        //监听提交
        form.on('submit(loginsubmit)', function(data){
            $.ajax({
                url: "<?php echo url('admin/login/login'); ?>",
                type: "post",
                cache: false,
                data: data.field,
                success: function (data) {
                    layer.msg(data.msg);
                    if(data.url){
                        setTimeout(function () {
                            location.href = data.url;
                        }, 1000);
                    }
                }
            });
            return false;
        });

    });
</script>
<script>
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;

    });
</script>
</body>
</html>